const user = require('../controllers/user')
const { formatBody } = require('../tools')

const initSocketListener = io => {
  io.sockets.on('connection', socket => {
    console.log('************connection************')
    // 下线
    socket.on('disconnect', (info) => {
      user.disconnect(info, socket, io)
    })
  })
}
module.exports = initSocketListener
